﻿using StockDashboard.DL.Yahoo;
using StockDashboard.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using System.Text;

namespace AG.Apps.WebServices
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IStockDashboardService
    {

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetQuotes/{symbol}?s={startDate}&e={endDate}&c={connectionString}", 
            RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json, 
           BodyStyle= WebMessageBodyStyle.Bare )]
        List<QuoteInfo> GetQuotes(string symbol, System.DateTime startDate, System.DateTime endDate, String connectionString);


        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/RefreshQuotes/{symbol}&c={connectionString}",
            RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json,
           BodyStyle = WebMessageBodyStyle.Bare)]
        void RefreshQuotes(String symbol, String connectionString);


        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/RefreshAll&c={connectionString}",
            RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json,
           BodyStyle = WebMessageBodyStyle.Bare)]
        void RefreshAll(String connectionString);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "/GetQuoteLatest/{symbol}?c={connectionString}",
            RequestFormat = WebMessageFormat.Json,
           ResponseFormat = WebMessageFormat.Json,
           BodyStyle = WebMessageBodyStyle.Bare)]
        string GetQuoteLatest(string symbol, String connectionString);

    }


   
}
